-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[GSoC 2017]Photometric Calibration. #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.x
Are you sure you want to change the base?
Conversation
2db5273
to
515aa60
Compare
515aa60
to
d4d89c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree -- let's change pcalib --> photometric_calib everywhere so it's obvious what it is. Nice work!
#include <iostream> | ||
#include <fstream> | ||
|
||
namespace cv{ namespace pcalib{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after cv
modules/pcalib/src/Reader.cpp
Outdated
#include "opencv2/pcalib/Reader.hpp" | ||
#include "precomp.hpp" | ||
|
||
namespace cv{ namespace pcalib{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after cv
modules/pcalib/src/pcalib.cpp
Outdated
#include "precomp.hpp" | ||
#include "opencv2/pcalib.hpp" | ||
|
||
namespace cv{ namespace pcalib{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after cv
modules/pcalib/src/precomp.hpp
Outdated
#ifndef __OPENCV_PRECOMP_H__ | ||
#define __OPENCV_PRECOMP_H__ | ||
|
||
#include <opencv2/core.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use quotes consistently
#ifndef __OPENCV_PCALIB_HPP__ | ||
#define __OPENCV_PCALIB_HPP__ | ||
|
||
#include <opencv2/core.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use quotes
modules/pcalib/src/Reader.cpp
Outdated
// | ||
|
||
#include "opencv2/pcalib/Reader.hpp" | ||
#include "precomp.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in cpp or test files precomp goes first
modules/pcalib/src/pcalib.cpp
Outdated
// | ||
//M*/ | ||
|
||
#ifndef __OPENCV_PCALIB_CPP__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include guards only for header files
modules/pcalib/src/pcalib.cpp
Outdated
|
||
#ifndef __OPENCV_PCALIB_CPP__ | ||
#define __OPENCV_PCALIB_CPP__ | ||
#ifdef __cplusplus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also only for headers, do we need this/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of basic things to correct.
@@ -0,0 +1,2 @@ | |||
Photometric Calibration | |||
================================================ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the documentation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
Thanks a lot for your comment!
class CV_EXPORTS PhotometricCalibrator : public Algorithm | ||
{ | ||
public: | ||
bool validImgs(std::vector <Mat> &inputImgs, std::vector<double> &exposureTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use tabs for indentation. Arguments should be const if they are const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks a lot for your comment!
class Reader | ||
{ | ||
public: | ||
Reader(std::string folderPath, std::string timesPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::string &
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks a lot for your comment!
@@ -0,0 +1,81 @@ | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget license at the top of every file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Vincent,
I think there is a shorter version (basically a link to http://opencv.org/license.html) and the complete OpenCV's license, which one should I use?
return (unsigned long)files.size(); | ||
} | ||
|
||
void Reader::loadTimestamps(std::string timesFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the format of that file ? You should use OpenCV serialization for whatever you do.
{ | ||
Mat img = imread(files[i]); | ||
CV_Assert(img.type() == CV_8U); | ||
if(0 == i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i==0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks a lot for your comment!
width = 0; | ||
height = 0; | ||
|
||
for(unsigned long i = 0; i < files.size(); ++i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use size_t instead of unsigned long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Vincent,
Should I also change
unsigned long getNumImages() const;
double getTimestamp(unsigned long id) const;
float getExposureTime(unsigned long id) const;
to
size_t getNumImages() const;
double getTimestamp(size_t id) const;
float getExposureTime(size_t id) const;
} | ||
} | ||
|
||
std::cout<<getNumImages()<<" imgases from"<<folderPath<<" loaded successfully!"<<std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use std::cout
Plus there is a typo: images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Vincent, thanks a lot for your comments!
Can I use std::cerr to output some error info?
return timeStamps[id]; | ||
} | ||
|
||
float Reader::getExposureTime(unsigned long id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this member function should be const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks a lot for your comment!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made 3 functions const:
unsigned long getNumImages() const;
double getTimestamp(unsigned long id) const;
float getExposureTime(unsigned long id) const;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for cout/cerr, a better reviewer should answer. It seems it it used in the main library too, my bad.
|
||
double getTimestamp(unsigned long id) const; | ||
|
||
float getExposureTime(unsigned long id) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe getExposureDuration would be more explicit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
#include <vector> | ||
#include <string> | ||
#include <iostream> | ||
#include <fstream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of those includes are useless in the header and should be in the .cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
inline void loadTimestamps(const std::string ×File); | ||
|
||
std::vector<String> files; | ||
std::vector<double> timeStamps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the format should be explained in the doc: what is that double ? Time since when ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Vincent,
Thanks for your comment.
doc means doxygen or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I thought timestamps always means the Unix Timestamp since Jan 01 1970?
fc0f84e
to
7c55a71
Compare
7132110
to
2dd0ab0
Compare
2dd0ab0
to
d0ec626
Compare
b010c10
to
15ca7a9
Compare
49646df
to
ceb2af6
Compare
…ethod calib() and calibFast(). And also change 'silent' to 'debug'.
f692ab5
to
30a8c09
Compare
30a8c09
to
6e97cc2
Compare
Added Class PhotometricCalibrator.
Added method PhotometricCalibrator::validImgs.
First commit with dummy function and stab implementation to get familiar with PR procedure.
@grace-
TODO:
std::vector
/cv::AutoBuffer
instead